package com.yykj.tencent.im.server.model.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Objects;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class FriendPK implements Serializable {
    private String fromAccount;
    private String toAccount;


    @Override
    public boolean equals(Object obj) {
        if(obj == this) return true;
        if(obj == null || getClass() != obj.getClass()) return false;
        FriendPK fpk = (FriendPK)obj;
        return Objects.equals(fromAccount,fpk.fromAccount) &&
                Objects.equals(toAccount,fpk.toAccount);
    }

    @Override
    public int hashCode() {
        return Objects.hash(fromAccount,toAccount);
    }
}
